Imports System.Xml.Serialization
Imports EdmxEditor.CodeGeneration

Namespace CSDL

    Public Class EntityContainerFunctionImport
        Inherits XEntityModelElementWithDocumentationBase

        ''' <summary>Initializes an instance of the <see cref="EntityContainerFunctionImport" /> class.
        ''' This is the default constructor for this class.</summary>
        Public Sub New()
            MyBase.New("FunctionImport", EdmXmlNamespace)
        End Sub

        ''' <summary>Initializes an instance of the <see cref="EntityContainerFunctionImport" /> class.</summary>
        ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
        Public Sub New(ByVal other As XElement)
            MyBase.New(other)
        End Sub

        Private __parameters As FunctionImportParameterCollection

        <AutoLoad()> _
        <XmlElement("Parameter", GetType(FunctionImportParameter))> _
        Public ReadOnly Property Parameters() As FunctionImportParameterCollection
            Get
                If (__parameters Is Nothing) Then
                    __parameters = New EdmxEditor.CSDL.FunctionImportParameterCollection(Me, MyBase.Name.Namespace, "Parameter")
                End If
                Return __parameters
            End Get
        End Property

        <XmlAttribute()> _
        Public Shadows Property Name() As String
            Get
                Return Me.@Name
            End Get
            Set(ByVal value As String)
                Me.@Name = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property ReturnType() As String
            Get
                Return Me.@ReturnType
            End Get
            Set(ByVal value As String)
                Me.@ReturnType = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property EntitySet() As String
            Get
                Return Me.@EntitySet
            End Get
            Set(ByVal value As String)
                Me.@EntitySet = value
            End Set
        End Property

        <XmlAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Qualified, [Namespace]:=CodeGenerationXmlNamespace)> _
        Public Property MethodAccess() As Access
            Get
                Return GetEnumValueAttribute(GetType(Access), Me.Attribute(XName.Get("MethodAccess", CodeGenerationXmlNamespace)))
            End Get
            Set(ByVal value As Access)
                If (Me.Attribute(XName.Get("MethodAccess", CodeGenerationXmlNamespace)) Is Nothing) Then
                    Me.Add(New XAttribute(XName.Get("MethodAccess", CodeGenerationXmlNamespace), ""))
                End If
                SetEnumValueAttribute(GetType(Access), Me.Attribute(XName.Get("MethodAccess", CodeGenerationXmlNamespace)), value)
            End Set
        End Property

    End Class

End Namespace